package com.sdp.th.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sdp.core.bizc.db.Query;
import com.sdp.core.bizc.vo.DataCenter;
import com.sdp.core.bizc.vo.Result;
import com.sdp.th.db.th_eq_state.service.IThEqStateService;
import com.sdp.th.db.th_eq_state.service.impl.ThEqStateServiceImpl;
import com.sdp.th.entity.ThEqState;
import com.sdp.th.view.ThEqStateView;

/**
 * <p>
 * 设备实时信息 前端控制器
 * </p>
 *
 * @author zsp
 * @since 2025-04-12
 */
@RestController
@RequestMapping("/ThEqStateController")
public class ThEqStateController {

	@Autowired
	private IThEqStateService iThEqStateService;
	
	@Autowired
	private ThEqStateServiceImpl thEqStateServiceImpl;

	@Autowired
	private Query query;

	
	@PostMapping(value = "/page")
	public Result<?> page(@RequestBody DataCenter dataCenter) {
		return Result.ok(query.page(iThEqStateService, ThEqState.class, dataCenter));
	}
	
	@PostMapping(value = "/viewList")
	public Result<?> viewPage(@RequestBody DataCenter dataCenter) {
		QueryWrapper<ThEqStateView> queryWrapper = new QueryWrapper<>();
		return Result.ok(query.viewList(thEqStateServiceImpl, ThEqStateView.class, dataCenter, queryWrapper));
	}
}

